<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function funload() {
				//	document.domain = 'baidu.com';
				var ifr = document.createElement('iframe');
				ifr.src = 'http://www.baidu.com';
				ifr.display = 'none';
				document.body.appendChild(ifr);
				ifr.onload = function() {
					var doc = ifr.contentDocument || ifr.contentWindow.document;
					//在这里操作doc，也就是b.html
					console.log(doc);

					ifr.contentWindow.close();
					document.body.removeChild(ifr);

					ifr.onload = null;
					ifr.src = '';
					ifr = null;
				};
			}
		</script>
	</head>

	<body>
		<button onclick="funload()">载入</button>
	</body>

</html>